load("//:build_variables.bzl", "COPTS")
load("//tools/lint:linters.bzl", "clang_tidy_test")

package(
    default_visibility = ["//:android_cuttlefish"],
)

cc_library(
    name = "instance",
    srcs = [
        "cf_boot_configs.cpp",
        "cf_connectivity_configs.cpp",
        "cf_disk_configs.cpp",
        "cf_graphics_configs.cpp",
        "cf_security_configs.cpp",
        "cf_streaming_configs.cpp",
        "cf_vm_configs.cpp",
    ],
    hdrs = [
        "cf_boot_configs.h",
        "cf_connectivity_configs.h",
        "cf_disk_configs.h",
        "cf_graphics_configs.h",
        "cf_security_configs.h",
        "cf_streaming_configs.h",
        "cf_vm_configs.h",
    ],
    deps = [
        "//cuttlefish/common/libs/utils:base64",
        "//cuttlefish/common/libs/utils:flags_validator",
        "//cuttlefish/common/libs/utils:result",
        "//cuttlefish/host/commands/assemble_cvd:launch_cvd_cc_proto",
        "//cuttlefish/host/commands/assemble_cvd:flags_defaults",
        "//cuttlefish/host/commands/cvd/cli/parser:configs_common",
        "//cuttlefish/host/commands/cvd/cli/parser:load_config_cc_proto",
        "//libbase",
        "@jsoncpp",
        "@protobuf",
        "@protobuf//:json_util",
    ],
)

cc_test(
    name = "instance_test",
    srcs = [
        "boot_configs_test.cc",
        "disk_configs_test.cc",
        "graphics_configs_test.cc",
        "vm_configs_test.cc",
    ],
    copts = COPTS + [ "-Icuttlefish" ],
    deps = [
        "//cuttlefish/common/libs/utils:base64",
        "//cuttlefish/common/libs/utils:flag_parser",
        "//cuttlefish/common/libs/utils:json",
        "//cuttlefish/common/libs/utils:result",
        "//cuttlefish/common/libs/utils:result_matchers",
        "//cuttlefish/host/commands/assemble_cvd:launch_cvd_cc_proto",
        "//cuttlefish/host/commands/cvd/cli/parser",
        "//cuttlefish/host/commands/cvd/cli/parser:configs_common",
        "//cuttlefish/host/commands/cvd/cli/parser:test_common",
        "//libbase",
        "@googletest//:gtest",
        "@googletest//:gtest_main",
        "@jsoncpp",
        "@protobuf",
        "@protobuf//:differencer",
    ],
)

clang_tidy_test(
    name = "instance_test_clang_tidy",
    srcs = [":instance_test"],
    tags = ["clang_tidy", "clang-tidy"],
)
